﻿<UserControl xmlns:KinectToMidi="clr-namespace:KinectToMidi.Views" 
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:ViewModels="clr-namespace:KinectToMidi.ViewModels" x:Class="KinectToMidi.Views.ConditionsMappingSetControl" 
             xmlns:properties="clr-namespace:KinectToMidi.Properties"
             mc:Ignorable="d" 
             d:DesignHeight="350" d:DesignWidth="600"
             DataContext="{Binding Main.BlocksSetVM, Source={StaticResource ViewModelLocatorDataSource}}">
    <UserControl.Resources>
        <DataTemplate x:Key="BlockDataTemplate">
            <Border BorderThickness="2" Margin="0, 0, 0, 10">
                <KinectToMidi:ConditionsBlocControl />
            </Border>
        </DataTemplate>
    </UserControl.Resources>
    <Grid x:Name="grid">
        <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"  Height="{Binding ActualHeight, ElementName=grid, Mode=OneWay}">
            <StackPanel>
                <ItemsControl ItemsSource="{Binding ConditionsBlocks}" ItemTemplate="{DynamicResource BlockDataTemplate}"/>
                <Button HorizontalAlignment="Left" ToolTip="{x:Static properties:Resources.Add}" 
                            Command="{Binding AddBlockCommand}">
                    <Image Height="32" Source="/KinectToMidi;component/Images/Awicons-Vista-Artistic-Add.ico" Stretch="Fill" Width="32"/>
                </Button>
            </StackPanel>
        </ScrollViewer>
    </Grid>
</UserControl>
